package com.example.consumer.controller;

import com.example.rpc.service.TestRpcService;
import lombok.Setter;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * dubbo测试接口
 * @author chengjian 
 * @date 2021/6/4
 */
@RestController
@RequestMapping(value = "/dubbo")
@Setter
public class RpcController {
    @DubboReference(interfaceClass = TestRpcService.class)
    private TestRpcService testRpcService;

    @GetMapping(value = "/test")
    public String test(){
        return testRpcService.test();
    }
}
